package com.guigu.www.service.imp;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.guigu.www.mapper.MManufactureMapper;
import com.guigu.www.mapper.MProcedureMapper;
import com.guigu.www.pojo.MProcedure;
import com.guigu.www.service.MProcedureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MProcedureServiceImpl extends ServiceImpl<MProcedureMapper, MProcedure> implements MProcedureService {
    @Autowired
    MProcedureMapper mProcedureMapperl;
    //总表
    @Autowired
    MManufactureMapper mManufactureMapper;
    @Override
    public MProcedure queryByMProcedureModule(int id) {
        return mProcedureMapperl.queryByMProcedureModule(id) ;
    }

    @Override
    public boolean updaterealamount(int id, int amount) {
        //修改合格数量
        //根据id查询
        MProcedure mProcedure=mProcedureMapperl.selectById(id);
        //根据当前id修改等待审核
        mManufactureMapper.updatemprocedurestatus(mProcedure.getParentId());

        return mProcedureMapperl.updaterealamount(id,amount)>0?true:false;
    }
}
